NextValue (fld)

Basic syntax.

NextValue and Next (fld) are equivalent functions. However, you can use NextValue only with Basic syntax and Next only with Crystal syntax.

Argument

fld is the name of a database field.

Returns

Value of specified field; type depends on type of that field.

Action

NextValue returns the value of the next record of the specified field.

Typical use

You can use NextValue to identify the first or last record in a range, to identify the starting point for a new group, or to test for duplicate values.

Examples

The following examples are applicable to Basic syntax:

If NextValue ({Orders Detail.Quantity}) <> 0 Then

    formula = {Orders Detail.Quantity} / 2

Else

    formula = {Orders Detail.Quantity}

End If

Tests the next value in the {Orders Detail.Quantity} field to see if it is zero. If it is not, it divides the current value by two. If it is zero, it returns the current value itself.

If NextValue ({Orders.Order ID}) Mod 10 = 0 Then

    formula = "End of block"

Else

    formula = "More to come"

End If

This formula divides orders into blocks of 10. If the next Order ID is a multiple of 10, it flags the current value as "End of block". Otherwise, it prints "More to come".

Note:    Using this function in a formula forces the formula to be evaluated at print time. For more information on evaluation time considerations, see Evaluation Time functions.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com